<template>
  <div class="FootballteamInfo">
    <div v-for="d in list" :key="d.ftid">
      <el-card>
        <template #header>
          <div class="card-header">
            <span>{{ d.source }}</span>
          </div>
        </template>
        <div></div>
      </el-card>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { api } from '../../js/ajax'
import { tools } from '../../js/tools'
import { ElMessageBox } from 'element-plus'
import { useRouter } from 'vue-router'

const router = useRouter()

const queryInfo = ref({
  orderBy: '',
  tname: '',
  league: '',
})
const page = ref({
  pageNumber: 1,
  pageSize: 10,
})
const list = ref([])

const showDetail = ftid => {
  router.push({
    path: '/crud/footballdetail',
    query: { ftid: ftid },
  })
}

const query = () => {
  api.get(
    '/crud/footballteam',
    tools.mergeJson(queryInfo.value, page.value),
    data => {
      if (data.success) {
        list.value = data.data.data
        page.value = data.data.pageBean
        return
      }
      ElMessageBox.alert(data.message, '球队管理')
    },
  )
}
query()
</script>
<style scoped></style>
